/*
 This file is part of ParagliderDesk.
 Copyright (C) 2009 Benjamin Loulier 
 
 ParagliderDesk is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 ParagliderDesk is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with ParagliderDesk.  If not, see <http://www.gnu.org/licenses/>.
 
 File: Location.m
 */

#import "Location.h"

@implementation Location

@synthesize coreLocationOutput;
@synthesize verticalSpeed, verticalSpeedAverage, glideRatio, glideRatioAverage;
@synthesize threeDFix;

- (id) init:(CLLocation *)CoreLocation {
	self = [super init];
	if (self != nil) {
		[self setCoreLocationOutput:CoreLocation];
	}
	verticalSpeed = -1;
	glideRatio = -1;
	threeDFix = FALSE;
	return self;
}

-(double)latitude {
	return [coreLocationOutput coordinate].latitude;
}

-(double)longitude {
	return [coreLocationOutput coordinate].longitude;
}

-(double)groundSpeed {
	return [coreLocationOutput speed];
}

-(double)groundSpeedKMH {
	return [coreLocationOutput speed]*3.6;
}

-(double)altitude {
	return [coreLocationOutput altitude];
}

-(double)course {
	return [coreLocationOutput course];
}

-(NSDate *)timestamp {
	return [coreLocationOutput timestamp];
}

@end
